package com.imooc.spring.lambda;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;

/**
 * Description：
 *
 * @Author: spring
 * @Date: 2021/6/16
 */
public class LambdaTest {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("java","python","php","html");
        filter(list,n->n.contains("a"));

    }

    public static  void filter(List<String> array,Predicate<String> predicate){
        for(String s : array){
            if(predicate.test(s)){
                System.out.print(s+" ");
            }
        }

    }
}
